package com.witdata.controller.community;

import com.witdata.common.domain.Result;
import com.witdata.common.domain.Status;
import com.witdata.common.domain.dto.TagDto;
import com.witdata.common.service.community.CommunityTagService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/community/tag")
@RequiredArgsConstructor
public class CommunityTagController {
    private final CommunityTagService communityTagService;

    @GetMapping("/list")
    public Result<List<TagDto>> getCommunityTagList(@RequestParam("communityId") Long communityId) {
        List<TagDto> communityTagList = communityTagService.getCommunityTagList(communityId);
        return Result.ok(Status.SUCCESS, communityTagList);
    }

}
